﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Framework.Utils
{
    public class ArrayUtils
    {

        /// <summary>
        /// 数组转字符串
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="arrays"></param>
        /// <returns></returns>
        [Obsolete("请使用StringUtils.ToString(Array array)")]
        public static string ToString<T>(T[] array)
        {
            int size = (array != null) ? array.Length : 0;
            if (size <= 0) { return "null"; }
            //遍历输出
            StringBuilder strBdr = new StringBuilder();
            for (int i = 0; i < size; i++)
            {
                T v = array[i];
                if (i > 0) { strBdr.Append(","); }
                strBdr.Append((v != null) ? v.ToString() : "null");
            }
            return strBdr.ToString();
        }



    }
}
